<template>
  <div class="order">
    <a-card title="品号检验列表">
      <a-form class="formHeader">
        <a-row justify="start" :gutter="24">
          <a-col class="formHeader-criteria">
            <a-row :gutter="16">
              <a-col span="6">
                <a-form-item label="品名" label-col-flex="80px">
                  <a-input v-model="optInForm.mb002" @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <a-col span="6">
                <a-form-item label="品号" label-col-flex="80px">
                  <a-input v-model="optInForm.ta006" @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <a-col span="6">
                <a-form-item label="工单单别" label-col-flex="80px">
                  <a-input v-model="optInForm.ta001" @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <a-col span="6">
                <a-form-item label="工单单号" label-col-flex="80px">
                  <a-input v-model="optInForm.ta002" @keyup.enter="init" />
                </a-form-item>
              </a-col>
              <!-- <a-col span="6">
                <a-form-item label="检验时机" label-col-flex="80px">
                  <a-select v-model="optInForm.type" @keyup.enter="init" @change="init">
                    <a-option value="restockInspect">来料检验</a-option>
                    <a-option value="courseInspect">过程检验</a-option>
                  </a-select>
                </a-form-item>
              </a-col> -->
            </a-row>
          </a-col>
          <a-col class="formHeader-btn">
            <a-space direction="vertical" :size="20">
              <a-button type="primary" @click="init">
                <template #icon>
                  <icon-search />
                </template>
                <template #default>查询</template>
              </a-button>
              <a-button @click="reset">
                <template #icon>
                  <icon-refresh />
                </template>
                <template #default>重置</template>
              </a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
      <a-table
        style="margin-top: 20px;"
        :columns="columns"
        :data="tabelList"
        :pagination="pagination"
        :row-selection="rowSelection"
        @page-change="handlePageChange"
        @page-size-change="handlePageSizeChange"
        @select="rowSelectBow"
        @select-all="selectAll"
      >
        <template #optional="{ record }">
          <a-space>
            <a-button type="primary" size="mini" @click="viewDetails(record)">查看详情</a-button>
            <a-button v-can-delete type="primary" size="mini" status="danger" @click="del(record)">删除</a-button>
          </a-space>
        </template>
      </a-table>
      <!-- <a-button type="primary" @click="printWindow"> 打印目标</a-button>
      <a-button type="primary" @click="printPom"> xbar图</a-button> -->
    </a-card>
  </div>
</template>

<script>
import { defineComponent, toRefs } from 'vue';
import importConfig from './inspectionDetailsList';
import FormHeader from '@com/formHeader/formHeader.vue';

export default defineComponent({
  name: 'OrderDom',
  components: { FormHeader },
  setup() {
    const {
      base,
      columns,
      collection,
      handlePageChange,
      handlePageSizeChange,
      viewInspect,
      viewDetails,
      init,
      printWindow,
      rowSelectBow,
      selectAll,
      printPom,
      reset,
      del,
    } = importConfig();
    init();
    return {
      ...toRefs(base),
      columns,
      collection,
      handlePageChange,
      handlePageSizeChange,
      viewInspect,
      viewDetails,
      init,
      printWindow,
      rowSelectBow,
      selectAll,
      printPom,
      reset,
      del,
    };
  },
});
</script>

<style lang="less" scoped>
:deep(.arco-card-header) {
  border-bottom: none;
}

:deep(.arco-card-header-title) {
  text-align: left;
}

.order {
  &-queryForm {
    &-criteria {
      flex: 1 1 0;
    }

    &-btn {
      border-left: 1px solid #ddd;
      flex: 0 0 86px;
      text-align: right;
    }
  }

  &-table {
    font-weight: 500;
  }
}
.formHeader {
  &-criteria {
    flex: 1 1 0;
  }

  &-btn {
    border-left: 1px solid #ddd;
    flex: 0 0 86px;
    text-align: right;
  }
}
:deep(.arco-form-item){
    margin-bottom: 10px;
}
</style>
